package cn.dw.mm.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.dw.mm.domain.Eightfield;
import cn.dw.mm.service.EightfieldService;

@Controller
@RequestMapping("/eightfield")
public class EightfieldController {
	@Autowired
	private EightfieldService eightfieldService;
	
	@RequestMapping("/all")
	@ResponseBody
	public List<Eightfield> selectByEightfield(Eightfield eightfield) {
		return eightfieldService.selectByEightfield(eightfield); 
	}
	
	@RequestMapping("/id")
	@ResponseBody
	public Integer getEightfieldId(Eightfield eightfield) {
	  return eightfieldService.getEightfieldId(eightfield); 
	}
	
	//通过id数组批量查询
	@RequestMapping("/ids")
	@ResponseBody
	public List<Eightfield> selectByIds(@RequestParam("ids") List<Integer> ids) {//添加@RequestParam("ids")，目的是跳过spring的bean封装
		return eightfieldService.selectByIds(ids); 
	}
}
